// mypage/webImage/webImage.js
var app=getApp();


Page({
  /*页面的初始数据*/
  data: {
    img_url: '',
    page: '',
    show_btn: false,
    token: ''
  },
  /*生命周期函数--监听页面加载*/
  onLoad: function (options) {
    var that=this;
    wx.setNavigationBarTitle({title: options.title})
    var page=options.page!='null'?options.page:false;
    that.setData({img_url:options.url,page:page,token:wx.getStorageSync('token')})
  },
  load_image:function(){
    var that=this;
    that.setData({show_btn:true})
  },
  jump_to:function(){
    var that=this,page=that.data.page,token=that.data.token;
    if(token){
      wx.navigateTo({
        url: that.data.page,
      })
    }else{
      wx.navigateTo({
        url: '../../pages/login/login',
      })
    }
  },
  onShow:function(){
    var that=this;
    if(app.globalData.login){
      app.globalData.login=false;
      app.globalData.change_dom=false;
      app.globalData.change_table=false;
      var token=wx.getStorageSync('token');
      //
      that.setData({token:token})
    }
  },
})